/*
 * @Author: ZephyrGao
 * @Date: 2024-03-01 15:23:01
 * @Description: login mock
 * Copyright (c) 2024 by ZephyrGao, All Rights Reserved. 
 */

export default [
  // Mock login API
  {
    url: '/api/login',
    method: 'post',
    response: ({ body } :any) => {
      const { username, password } = body;
      // Mock logic for authentication
      if (username === 'demo' && password === 'password') {
        return {
          code: 200,
          message: 'Login successful',
          data: {
            token: 'mocked-token',
            username: 'demo',
          },
        };
      } else {
        return {
          code: 401,
          message: 'Invalid credentials',
        };
      }
    },
  },
];